package leetcode.code1023;

import java.util.ArrayList;
import java.util.List;

public class Solution {
	public List<Boolean> camelMatch(String[] queries, String pattern) {
		List<Boolean> ans = new ArrayList<>();
		char[] cs = pattern.toCharArray();
		int len = cs.length;
		for (int i = 0; i < queries.length; i++) {
			int p = 0;
			boolean cur = true;
			for (char c : queries[i].toCharArray()) {
				if (p < len && c == cs[p]) {
					p++;
				} else if (c >= 'A' && c <= 'Z') {
					cur = false;
					break;
				}
			}
			ans.add(cur ? p == len : cur);
		}
		return ans;
	}
}
